﻿DO language plpgsql $$
declare
vResult  text := null;
vIdPosterminal text := null;
vXmlData xml := '<posterminal id="-9000">
   <serialnumber>TestSerial 2013/02/14 21:59:17</serialnumber>
   <inventorynumber>TestInventory 2013/02/14 21:59:17</inventorynumber>
</posterminal>';


begin
vResult := posterminalsave(vXmlData);
vIdPosterminal := extract_value('/posterminal/@id', vXmlData);
RAISE NOTICE '%', vResult;
RAISE NOTICE '%', vXmlData;
end;
$$; 